package com.sk.sk_frame_cloud.controller;


import com.sk.sk_frame_cloud.param.SysFunctionParam;
import com.sk.sk_frame_cloud.res.CommonResponse;
import com.sk.sk_frame_cloud.service.IFunctionsService;
import com.sk.sk_frame_cloud.service.ISysProFunInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 系统功能
 * @author jiaok
 * @since 2023-12-20
 */
@RestController
@RequestMapping("sys-pro-fun-info")
public class SysProFunInfoController {
    @Resource
    private ISysProFunInfoService iSysProFunInfoService;
    /**
     * 没有所需要的功能，需要手动进行添加功能时，调用此接口,添加的同时将信息追加到项目中
     * @param functionParam
     * @return
     */
    @ApiOperation(value = "增加新的项目功能",notes = "新增的同时，将功能信息绑定在项目上",httpMethod = "POST")
    @PostMapping("/addAndBindingNewFunction")
    public CommonResponse addFunction(@RequestBody SysFunctionParam functionParam){
        return iSysProFunInfoService.addFunction(functionParam);
    }

    @PostMapping({"getProManageFunList"})
    @ApiOperation(value = "获取所有功能",notes = "获取所有功能",httpMethod = "POST")
    public CommonResponse getProManageFunList() {
        return  iSysProFunInfoService.getProManageFunList();
    }

    /**
     * 只添加功能,不做绑定
     * @return
     */
    @PostMapping({"addNewFunction"})
    @ApiOperation(value = "增加新的项目功能",notes = "只做添加",httpMethod = "POST")
    public CommonResponse addNewFunction(@RequestBody SysFunctionParam functionParam ){
        return  iSysProFunInfoService.addNewFunction(functionParam);
    }



}
